package com.smart.agent.bean.remote;

import com.smart.agent.tools.json.JsonHelper;

public class RemoteBean {
    protected String agentKey; // agent的key，也是唯一标识
    protected String udId = ""; // 设备id，要控制的手机或浏览器

    protected String cmd; // 执行命令
    protected String uuid = ""; // 执行的唯一标识
    protected Object data; // 执行远程控制需要的数据

    protected long start; // 执行开始时间
    protected long stop; // 执行结束时间
    protected long duration; // 执行时长
    protected boolean status; // 执行状态
    protected Object result; // 执行结果

    public String getAgentKey() {
        return agentKey;
    }

    public void setAgentKey(String agentKey) {
        this.agentKey = agentKey;
    }

    public String getUdId() {
        return udId;
    }

    public void setUdId(String udId) {
        this.udId = udId;
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public Object getResult() {
        return result;
    }

    public void setResultFail(Object result) {
        this.status = false;
        this.result = result;
    }

    public void setResultSuccess(Object result) {
        this.status = true;
        this.result = result;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getStop() {
        return stop;
    }

    public void setStop(long stop) {
        this.stop = stop;
        duration = stop - start;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return JsonHelper.toJsonString(this);
    }
}


